package com.blb.community_admin.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.community_admin.entity.SysPost;
import com.blb.community_admin.mapper.SysPostMapper;
import com.blb.community_admin.service.ISysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author hkp
 */
@Service
public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements ISysPostService {

    @Resource
    private SysPostMapper sysPostMapper;

    @Override
    public IPage<SysPost> selectPostPage(Integer current, Integer size, String postCode, String postName, String status) {
        return sysPostMapper.selectPostPage(new Page<>(current, size), postCode, postName, status);
    }

    @Override
    public SysPost getPostByuserId(long userId) {
        return sysPostMapper.selectPostByuserId(userId);
    }
}
